package org.deltaset.meta.faces;

import java.io.Serializable;
import org.deltaset.meta.ExecutorResult;
import org.deltaset.meta.MetaActionExecutor;
import org.deltaset.meta.MetaEntry;
import org.primefaces.model.LazyDataModel;

/**
 *
 * @author dmakariev
 */
class MetaEntryState implements Serializable {

    private final MetaEntry metaEntry;
    private MetaActionExecutor finder;
    private MetaActionExecutor executor;
    private ExecutorResult executorResult;
    private LazyDataModel<Object> lazyDataModel;
    private Object model;

    public MetaEntryState(MetaEntry metaEntry) {
        this.metaEntry = metaEntry;
    }
    
    public LazyDataModel<Object> getLazyDataModel() {
        return lazyDataModel;
    }

    public void setLazyDataModel(LazyDataModel<Object> lazyDataModel) {
        this.lazyDataModel = lazyDataModel;
    }

    public MetaEntry getMetaEntry() {
        return metaEntry;
    }

    public MetaActionExecutor getFinder() {
        return finder;
    }

    public MetaActionExecutor getExecutor() {
        return executor;
    }

    public ExecutorResult getExecutorResult() {
        return executorResult;
    }

    void setExecutor(final MetaActionExecutor executor) {
        this.executor = executor;
        ///////
        if (null != executor) {
            this.setExecutorResult(null);
        }
    }

    public Object getModelDirect() {
        return model;
    }

    void setModelDirect(final Object model) {
        this.model = model;
    }

    void setExecutorResult(final ExecutorResult executorResult) {
        this.executorResult = executorResult;
    }

    void setFinder(final MetaActionExecutor executor) {
        this.finder = executor;
    }
}
